#include <iostream>
#include <assert.h>
#include <vector>
#include <string>

using namespace std;

#include "BinarySearchTree.h"

void test1()
{
	int a[] = { 31, 3,4,1,6,7,8,5,2,0 };
	BSTree<int> b1;

	for (auto e : a)
	{
		b1.insert(e);
	}
	b1.InOrder();
	cout << endl;

	//for (auto e : a)
	//{
	//	b1.erase(e);
	//	b1.InOrder();
	//	cout << endl;
	//}

	b1.erase(99);
}

void test2()
{
	int a[] = { 31, 3,4,1,6,7,8,5,2,0 };
	BSTree<int> b1;

	for (auto e : a)
	{
		b1.insertR(e);
	}
	b1.InOrder();
	cout << endl;
	BSTree<int> b2(b1);

	for (auto e : a)
	{
		b1.eraseR(e);
		b1.InOrder();
		cout << endl;
	}

	//b1.InOrder();
	//b1.eraseR(99);
	b2.InOrder();
	b2.eraseR(31);
	cout << endl;

	BSTree<int> b3;
	b3 = b2;
	b3.InOrder();
}

int main()
{
	//test1();
	test2();

	return 0;
}
